var teacherModule = require('./teacher.js');
var studentModule = require('./student.js');
var klassModule = require('./klass.js');
function teacherTestClass2(){
    var classes = [new klassModule.klass(2),new klassModule.klass(3)];
    var tom = new teacherModule.Teacher(3 , 'Tom' , 21 , classes);
    var expectResult = 'My name is Tom. I am 21 years old. I am a Teacher. I teach Class 2, 3.';
    (expectResult === tom.introduce()) ? console.log('teacherTestClass2 passed!') : console.log('teacherTestClass2 failed!');
} 

function teacherTestNoClass(){
    var classes = [];
    var tom = new teacherModule.Teacher(3 , 'Tom' , 21 , classes);
    var expectResult = 'My name is Tom. I am 21 years old. I am a Teacher. I teach No Class.';
    (expectResult === tom.introduce()) ? console.log('teacherTestNoClass passed!') : console.log('teacherTestNoClass failed!');
}

function notTeachingTest(){
    var class2 = new klassModule.klass(2);
    var class3 = new klassModule.klass(3);
    var classes = [class2 , class3];
    var tom = new teacherModule.Teacher(3 , 'Tom' , 21 , classes);
    var jack = new studentModule.Student(2 , 'Jack' , 21 , new klassModule.klass(1));
    var expectResult = false;
    (expectResult === tom.isTeaching(jack)) ? console.log('notTeachingTest passed!') : console.log('notTeachingTest failed!');
}

function isTeachingTest(){
    var class2 = new klassModule.klass(2);
    var class3 = new klassModule.klass(3);
    var classes = [class2 , class3];
    var tom = new teacherModule.Teacher(3 , 'Tom' , 21 , classes);
    var jack = new studentModule.Student(2 , 'Jack' , 21 , new klassModule.klass(2));
    var expectResult = true;
    (expectResult === tom.isTeaching(jack)) ? console.log('isTeachingTest passed!') : console.log('isTeachingTest failed!');
}

teacherTestClass2();
teacherTestNoClass();
notTeachingTest();
isTeachingTest();
